<script type="text/javascript">
function savedept_user(){
	var zTree = $.fn.zTree.getZTreeObj("treeuserid")
    var users = zTree.getNodes();
	$("#treeuserid").bjuiajax('doAjax', {url:"${ctx}/dept/deptUserSave",confirmMsg:"是否确定需要保存？",data:{'users':JSON.stringify(users[0]),'deptid':"${deptid}"}});
}
</script>
<%
  if (susers != null && susers.~size > 0){
%>
<button class="btn btn-green" onclick="savedept_user();">保存部门用户</button>
<ul id="treeuserid" class="ztree" data-toggle="ztree" data-expand-level="2"
	data-expand-all="true" data-check-enable="true">
	<li data-id="-1" data-faicon="users">用户</li>
	  <%
         for (suser in susers){
      %>
		<li data-id="${suser.id!}" data-pid="-1"
		data-checked="${suser.checked!}"
		data-faicon="user">${suser.realname!}</li>
	  <%
	     }
	  %>
</ul>
<%
  }
%>